import request from '@/config/axios'

export interface MgmtDefectiveProductRegistrationVO {
  id: number
  inspectionTaskCode: string
  productCode: string
  partCode: string
  partName: string
  defectiveQuantity: number
  drawingNumber: string
  dictInspectionType: number
  dictStatus: number
  description: string
  dictFinalConclusion: number
  inspectionNotes: string
  customerName: string
  unit: string
}

// 查询质量管理-品质管理-异常品登记列表
export const getMgmtDefectiveProductRegistrationPage = async (params) => {
  return await request.get({ url: `/quality/mgmt-defective-product-registration/page`, params })
}

// 查询质量管理-品质管理-异常品登记详情
export const getMgmtDefectiveProductRegistration = async (id: number) => {
  return await request.get({ url: `/quality/mgmt-defective-product-registration/get?id=` + id })
}

// 新增质量管理-品质管理-异常品登记
export const createMgmtDefectiveProductRegistration = async (data: MgmtDefectiveProductRegistrationVO) => {
  return await request.post({ url: `/quality/mgmt-defective-product-registration/create`, data })
}

// 修改质量管理-品质管理-异常品登记
export const updateMgmtDefectiveProductRegistration = async (data: MgmtDefectiveProductRegistrationVO) => {
  return await request.put({ url: `/quality/mgmt-defective-product-registration/update`, data })
}

// 删除质量管理-品质管理-异常品登记
export const deleteMgmtDefectiveProductRegistration = async (id: number) => {
  return await request.delete({ url: `/quality/mgmt-defective-product-registration/delete?id=` + id })
}

// 导出质量管理-品质管理-异常品登记 Excel
export const exportMgmtDefectiveProductRegistration = async (data) => {
  return await request.download({ url: `/quality/mgmt-defective-product-registration/export-excel`, data })
}

// 获得当前登录人检验类型
export const getCheckType = async () => {
  return await request.get({ url: `/quality/mgmt-defective-product-registration/get-check-type` })
}

// 获取部件信息列表
export const getPartInfoList = async (params) => {
  return await request.get({ url: `/quality/mgmt-defective-product-registration/get-part-info-list`,params })
}

